//-------------------------------------------------------------------
//	Copyright (c) 2010-2012  Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_WINDOWS_TYPES_H
#define _UX_WINDOWS_TYPES_H

#ifdef PLATFORM_WINDOWS

#include "../../GL/wglext.h"
#include "../../Enums/KeyCodes.h"

namespace Engine
{
namespace UXTypes
{

	#define UX_OSAPI	CWinAPI
	struct TWinMsg;					typedef TWinMsg					TSystemMsg;
	struct TWinHandles;				typedef TWinHandles				THandles;



	//
	// Windows Message
	//

	struct TWinMsg
	{
		UINT	uMsg;
		WPARAM	wParam;
		LPARAM	lParam;
		///
		TWinMsg(): uMsg(0), wParam(0), lParam(0) {}
		TWinMsg(UINT msg, WPARAM wparam, LPARAM lparam): uMsg(msg), wParam(wparam), lParam(lparam) {}
	};



	//
	// Windows Handles
	//

	struct TWinHandles
	{
		HINSTANCE		hInstance;			// Application Instance
		HWND			hWnd;				// Window Handle
		HDC				hDC;				// Device Context
		HGLRC			hRC;				// Rendering Context
		string			sClassName;			// Class Name
		///
		TWinHandles():
			hInstance(nullptr), hWnd(nullptr), hDC(nullptr), hRC(nullptr)
		{}

		bool Valid() const
		{
			return ( hInstance != nullptr && hWnd != nullptr && hDC != nullptr &&
					 hRC != nullptr && !sClassName.Empty() );
		}
	};

//-------------------------------------------------------------------

}	// UXTypes
}	// Engine

#endif	// PLATFORM_WINDOWS

#endif	// _UX_WINDOWS_TYPES_H